// cmpflt.c -- 浮点数比较
#include<math.h>
#include<stdio.h>
int main(void)
{
    const double ANSWER = 3.14159;
    double response;

    printf("What is the value of pi?\n");
    scanf("%lf",&response);
    while (fabs(response - ANSWER) > 0.0001)  /*此处含义是用户输入的值与正确值之间相差不大于0.0001，否则会一直提示用户继续输入。*/
    {
        printf("Try again!\n");
        scanf("%lf",&response);
    }
    printf("Close enough!\n");

    return 0;
    
}